package com.lite;

import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob;
import org.springframework.stereotype.Component;

import java.time.LocalTime;

/**
 * @description:
 * @author: sksun2
 * @create: 2023-02-11
 */
@Component
@Slf4j
public class MySimpleJob implements SimpleJob {

    @Override
    public void execute(ShardingContext shardingContext) {
        log.info("SimpleJob:{} 当前分片项:{},总分片项:{},业务参数:{}", LocalTime.now(),shardingContext.getShardingItem(),
                shardingContext.getShardingTotalCount(),shardingContext.getJobParameter());
    }

}
